home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1994 November / Cd Ware (Nro. 2) - Epimundo.iso / DOS / PG / RES101.ZIP / ERROR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-15  |  840 b   |  39 lines

  1. #if !defined (ERRORdotH)
  2. #define ERRORdotH
  3.  
  4.  
  5. //*****
  6. //***** Error reporting class.
  7. //*****
  8.  
  9. class ErrorReporter
  10. {
  11.   int (*reportFunc)(char *errorString);     // function used to report error
  12. public:
  13.   ErrorReporter();
  14.   void operator << (char *errorString);     // report an error
  15.   inline void reporter(int(*func)(char *str));
  16. };
  17.  
  18. extern ErrorReporter errorReporter;
  19.  
  20.  
  21.  
  22. /**************************************************************************
  23. *  Function:    ErrorReporter::reporter
  24. *
  25. *  Purpose:     Change the current reporting function.
  26. *
  27. *  Entry:       func = Pointer to the new reporting function.
  28. *
  29. *  Exit:        N/A
  30. **************************************************************************/
  31.  
  32. inline void ErrorReporter::reporter(int (*func)(char *str))
  33. {
  34.   reportFunc = func;
  35. }
  36.  
  37.  
  38. #endif
  39.